<!doctype html>
<html>
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>后台登陆</title>
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta name="renderer" content="webkit">
  <meta http-equiv="Cache-Control" content="no-siteapp" />
<!--   <link rel="icon" type="image/png" href="assets/imgs/favicon.png"> -->
<!--   <link rel="apple-touch-icon-precomposed" href="assets/i/app-icon72x72@2x.png"> -->
  <meta name="apple-mobile-web-app-title" content="后台登陆" />
  <link rel="stylesheet" href="#(ctx)/assets/thirdparty/amazeui/css/amazeui.min.css">
  <link rel="stylesheet" href="#(ctx)/assets/css/backstage/admin.css">
  <link rel="stylesheet" href="#(ctx)/assets/css/backstage/app.css">
  <script src="#(ctx)/assets/thirdparty/jquery/jquery-1.11.3.min.js" type="text/javascript"></script>
</head>

<body data-type="login">
  <div class="am-g myapp-login">
	<div class="myapp-login-logo-block  tpl-login-max">
		<div class="myapp-login-logo-text">
			<div class="myapp-login-logo-text">
				后台<span> 登陆</span> <i class="am-icon-skyatlas"></i>
				
			</div>
		</div>

		<div class="am-u-sm-10 login-am-center">
			<form class="am-form">
				<fieldset>
					<div class="am-form-group">
						<input type="text" class="" id="usercode" placeholder="请输入账户" />
					</div>
					<div class="am-form-group">
						<input type="password" class="" id="password" placeholder="请输入密码" />
					</div>
					<p><button type="button" class="am-btn am-btn-default" id="loginCheck">登录</button></p>
				</fieldset>
			</form>
		</div>
	</div>
</div>

#include("../../_modal.html");

<script>
(function(){
	$("#loginCheck").click(function(){
		loginCheck();	
	});
})();


function loginCheck() {
	var usercode = $("#usercode").val().trim();
	var password = $("#password").val().trim();
	
	if (usercode == '') {
		alertModal('输入账户撒');
		return;
	}
	
	if (password == '') {
		alertModal('输入密码撒');
		return;
	}
	
	// 登陆中
	$("#loginCheck").addClass("am-disabled");
	
	$.post("#(ctx)/loginCheck", {
		"usercode": usercode,
		"password": hex_md5(password)
	},function(res){
		$("#loginCheck").removeClass("am-disabled");
		if (res.retcode == '0000') {
			// 跳转后台首页
			top.location.href = "#(ctx)/bindex";
			
		} else {
			alertModal(res.retmsg);
		}
		
	})
		
}

</script>
<script src="#(ctx)/assets/thirdparty/amazeui/js/amazeui.min.js" type="text/javascript"></script>
<script src="#(ctx)/assets/js/backstage/MD5.js" type="text/javascript"></script>
<script src="#(ctx)/assets/js/backstage/app.js" type="text/javascript"></script>
</body>
</html>